﻿// Copyright © 2011 Paul Vanukoff (pvanukoff@gmail.com)

using Bravura.Core.PluginLib;

namespace Bravura.Native.PluginBase
{
	/// <summary>
	/// A dummy buffer. Writing does nothing. Reading always returns an array of zero values.
	/// </summary>
	public class NullBuffer : IAudioBuffer
	{
		private double[] _data = new double[0];

		public void SetGain(double gain)
		{
		}

		public void Write(double[] data, int count)
		{
		}

		public double[] Read(int count)
		{
			if (count > _data.Length)
			{
				_data = new double[count];
			}
			return _data;
		}
	}
}
